package bg.unisofia.fmi.tis.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="t_user")
public class User extends Identity {
	
	private Role role;
	private String name;
	
	private List<Thesis> submitedThesises = new ArrayList<Thesis>();
	private List<Thesis> verifiedThesises = new ArrayList<Thesis>();
	
	private List<Comment> comments = new ArrayList<Comment>();
	
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade=CascadeType.ALL, mappedBy="student")
	public List<Thesis> getSubmitedThesises() {
		return submitedThesises;
	}

	public void setSubmitedThesises(List<Thesis> thesises) {
		this.submitedThesises = thesises;
	}

	@OneToMany(cascade=CascadeType.ALL, mappedBy="supervisor")
	public List<Thesis> getVerifiedThesises() {
		return verifiedThesises;
	}

	public void setVerifiedThesises(List<Thesis> verifiedThesises) {
		this.verifiedThesises = verifiedThesises;
	}

	@OneToMany(cascade=CascadeType.ALL, mappedBy="professor")
	public List<Comment> getComments() {
		return comments;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}
}
